import { Module } from '@nestjs/common';
import { JwtModule } from '@nestjs/jwt';
import { jwtConstants, signInExpire } from './constants';
import { Anonymmous } from './decorators/anonymous.decorator';
import { AuthRestfulGuard } from './guards/auth.restful';

@Module({
  imports: [
    JwtModule.register({
      global: true,
      secret: jwtConstants.secret,
      signOptions: { expiresIn: signInExpire },
    }),
  ],

  exports: [AuthRestfulGuard, Anonymmous],
})
export class CommonModule {}
